Skip to content

Instantly share code, notes, and snippets.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

{
"type": "object",
"properties": {
"draft_reply": {
"type": "string",
"description": "The complete customer-facing email reply only. No internal notes."
},
"category": {
"type": "string",
"enum": [
@tandpfun
tandpfun / SKILL.md
Created July 14, 2026 02:16
Extract Clothing Skill
name extract-clothing-cutouts
description Extract high-quality, deduplicated transparent ecommerce clothing cutouts from a folder of photographs where people wear one or more garments. Use when Codex must find outfit or model photos, identify unique clothing across images, create focused references, reconstruct complete garments with Imagegen, remove a solid chroma background into RGBA PNGs, and output only the finished clothing images into a new folder under the current working directory.

Extract Clothing Cutouts

Turn photographs of worn clothing into source-faithful standalone catalog PNGs. Treat each result as a reconstruction from visible evidence, not literal segmentation whenever the wearer or another layer occludes part of the garment.

Start by asking for two paths

@erikkinding
erikkinding / kafka-local-docker-compose.yaml
Last active July 14, 2026 20:10
Docker compose for local Kafka setup with kafka-ui
# This setup allows you to both connect from within the docker-compose context as well as from services running on your local
# machine but not as part of the docker-compose setup. Any client connecting to the broker from the outside can connect to
# localhost:9092 while services running as part of the docker-compose connect to broker:9093.
#
# To access kafka-ui: http://localhost:7777
#
# I hope this helps someone out there! :)
version: '3'
networks:
@1337-server
1337-server / Export-MFP-data.js
Last active July 14, 2026 20:04
Exports your full MyFitnessPal diary via the official API — monthly JSONs with automatic daily breakdown, all packed into a single ZIP.
// ==UserScript==
// @name MyFitnessPal Full Export → ZIP (API Monthly + Weight)
// @namespace http://github.com/1337-server
// @version 2.7
// @description Fetch monthly diary via API, store month JSONs, extract per-day JSONs (gap-filled), and fetch 1-year weight report (normalized dates) into weight.json
// @author 1337-server
// @license MIT
// @match https://www.myfitnesspal.com/*
// @grant GM_addStyle
// @downloadURL https://update.greasyfork.org/scripts/554485/MyFitnessPal%20Full%20Export%20%E2%86%92%20ZIP%20%28API%20Monthly%20%2B%20Weight%29.user.js
Set up these as real Codex lifecycle hooks by following the official documentation:
https://learn.chatgpt.com/docs/hooks
Important: use ~/.codex/hooks.json and a PreToolUse command hook. Do not implement this only as a ~/.codex/rules/*.rules execution-policy file.
First inspect any existing hooks and preserve them. Then:
1. Create or merge ~/.codex/hooks.json with a PreToolUse matcher for Bash.
2. Create ~/.codex/hooks/destructive_commands.py.
3. The script must read the hook JSON payload from stdin and inspect tool_input.command.